<template>
  <div class="h-panel">
    <PaasTitleBar></PaasTitleBar>
    <div class="h-panel-body bottom-line">
      <Form ref="form" :validOnChange="true" :showErrorTip="true" labelPosition="left" :labelWidth="110" :rules="vRules" :model="model" >
        <FormPageSelect label="所属项目" prop="projectId" v-model="model.projectId" url="/srproject/select"></FormPageSelect>
        <FormInput label="功能名称" prop="modularName" v-model="model.modularName"></FormInput>
        <FormInput label="表名称" prop="modularId" v-model="model.modularId"></FormInput>
      </Form>
    </div>
    <PaasButtonBar></PaasButtonBar>
  </div>
</template>
</template>

<script>
export default {
  async mounted() {
    let id = this.$route.query.id;
    if (!!id) {
      this.model = await this.$store.dispatch("getFormData", id);
    }
  },
  data() {
    return {
      model: {
        modularId: "",
        modularName: "",
        projectId: "",
      },
      vRules: {
        required: ["modularId", "modularName", "projectId"],
      },
    };
  },
  deactivated() {
    this.$destroy(true);
  },
};
</script>
